<HTML><FONT FACE=Arial, Verdana, Sans><TITLE>HighFrequencyTrader.agent</TITLE><BODY><STYLE TYPE="text/css"><!--.centeralign <BLOCKQUOTE>text-align:center</BLOCKQUOTE>--></STYLE><HEAD><P CLASS="centeralign">HighFrequencyTrader.agent</P></HEAD><IMG SRC=images/highfrequency.HighFrequencyTrader.png border=1 alt="Flowchart for HighFrequencyTrader.agent" title="Flowchart for HighFrequencyTrader.agent"></P>The package name is "highfrequency".</p>
The following external code is referenced:<BLOCKQUOTE></p>
<li>Components from java.io.*</li></p>
<li>Components from java.math.*</li></p>
<li>Components from java.util.*</li></p>
<li>Components from javax.measure.unit.*</li></p>
<li>Components from org.jscience.mathematics.number.*</li></p>
<li>Components from org.jscience.mathematics.vector.*</li></p>
<li>Components from org.jscience.physics.amount.*</li></p>
<li>Components from repast.simphony.adaptation.neural.*</li></p>
<li>Components from repast.simphony.adaptation.regression.*</li></p>
<li>Components from repast.simphony.context.*</li></p>
<li>Components from repast.simphony.context.space.continuous.*</li></p>
<li>Components from repast.simphony.context.space.gis.*</li></p>
<li>Components from repast.simphony.context.space.graph.*</li></p>
<li>Components from repast.simphony.context.space.grid.*</li></p>
<li>Components from repast.simphony.engine.environment.*</li></p>
<li>Components from repast.simphony.engine.schedule.*</li></p>
<li>Components from repast.simphony.engine.watcher.*</li></p>
<li>Components from repast.simphony.groovy.math.*</li></p>
<li>Components from repast.simphony.integration.*</li></p>
<li>Components from repast.simphony.matlab.link.*</li></p>
<li>Components from repast.simphony.query.*</li></p>
<li>Components from repast.simphony.query.space.continuous.*</li></p>
<li>Components from repast.simphony.query.space.gis.*</li></p>
<li>Components from repast.simphony.query.space.graph.*</li></p>
<li>Components from repast.simphony.query.space.grid.*</li></p>
<li>Components from repast.simphony.query.space.projection.*</li></p>
<li>Components from repast.simphony.parameter.*</li></p>
<li>Components from repast.simphony.random.*</li></p>
<li>Components from repast.simphony.space.continuous.*</li></p>
<li>Components from repast.simphony.space.gis.*</li></p>
<li>Components from repast.simphony.space.graph.*</li></p>
<li>Components from repast.simphony.space.grid.*</li></p>
<li>Components from repast.simphony.space.projection.*</li></p>
<li>Components from repast.simphony.ui.probe.*</li></p>
<li>Components from repast.simphony.util.*</li></p>
<li>Components from simphony.util.messages.*</li></p>
<li>Components from static java.lang.Math.*</li></p>
<li>Components from static repast.simphony.essentials.RepastEssentials.*</li></p>
</BLOCKQUOTE><P></p>
The class "HighFrequencyTrader" is defined with visibility "public" . This is an agent.</p>
 <BLOCKQUOTE></p>
</p>
    <li>There is a field named "symbol" with visibility "public" of type "String" and default value "INDEXSP". This is an agent property. The block is tagged with the name "Security Symbol".</li></p>
</p>
    <li>There is a field named "quantity" with visibility "public" of type "int" and default value 100. This is an agent property. The block is tagged with the name "Bid Quantity".</li></p>
</p>
    </p>
    </p>
        <li>There is a method named "bidorask" method has visibility     "public". This is the step behavior. The block is tagged with the name "BidOrAsk".</li></p>
    </p>
    </p>
    <BLOCKQUOTE>The bidorask method is statically scheduled as follows:<BLOCKQUOTE></p>
        <li>start = 1d</li></p>
        <li>interval = 1d</li></p>
        <li>shuffle = true</li></p>
    </BLOCKQUOTE></BLOCKQUOTE></p>
 <BLOCKQUOTE>The code for the "bidorask" method is as follows:<BLOCKQUOTE><CODE></p>
</p>
</p>
         Note the simulation time.</p>
        def time = GetTickCountInTimeUnits()</p>
</p>
</p>
         This is an agent decision.</p>
        if ((RandomHelper.getNormal().nextDouble(0.0, 1.0) < .5)) <BLOCKQUOTE></p>
</p>
             This is a task.</p>
            Ask(symbol, agentID, quantity)</p>
</p>
        </BLOCKQUOTE> else  <BLOCKQUOTE></p>
</p>
             This is a task.</p>
            Bid(symbol, agentID, quantity)</p>
</p>
        </BLOCKQUOTE></p>
         End the method.</p>
        return</p>
</p>
    </BLOCKQUOTE></BLOCKQUOTE></CODE></p>
</p>
</p>
</p>
</BLOCKQUOTE></p>
</p>
</BODY></HTML>